﻿<%@ Page Language="C#" MasterPageFile="~/Manage/MainPage.master"  AutoEventWireup="true" CodeFile="ConsultManage.aspx.cs" Inherits="Manage_ConsultManage" %>
<%@ Import Namespace="Shopping.Common" %>
<%@ Import Namespace="Shopping.Model" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
<script type="text/javascript" src="/Manage/Js/ConsultManage.js"></script>
<script type="text/javascript">

</script>

<table width="99%" border="0" cellspacing="0" cellpadding="0" class="table" align="center">
  <tr>
    <td align="center"><img src="/Manage/Images/sousuo.gif" />咨询内容：
      <input name="txtKeyWords" type="text" id="txtKeyWords" size="50" value="<%=keyWords %>"  class="border6"/>
      &nbsp;状态：
	  <select name="ddlStatus" id="ddlStatus">
  <option value="">--全部--</option>
  <option value="未回复" <%=status == GoodsConsultStatus.未回复.ToString()?"selected":"" %>>未回复</option>  
  <option value="已回复" <%=status == GoodsConsultStatus.已回复.ToString()?"selected":"" %>>已回复</option>
</select>
	  <input name="btnSearch" type="button" id="btnSearch" value="执行搜索" class="btn2"  onclick="GoToSearch();"/>
	  [ <a href="ConsultManage.aspx" class="red bold">查看全部</a> ] </td>
  </tr>
</table>
  <br />
<table width="99%" border="0" cellspacing="0" cellpadding="0" class="table" align="center">
  <tr>
    <td colspan="6" align="left" class="HeadTitle">&gt;&gt;商品咨询管理</td>
  </tr>
  <tr class="TableHeadRow">
    <td width="70" align="center">序号</td>
    <td align="left">咨询内容</td>
    <td width="250" align="center">咨询商品</td>
    <td width="100" align="center">会员账号</td>
    <td width="120" align="center">咨询时间</td>
    <td width="130" align="center">管理</td>
  </tr>
  <%
      if (listOfData != null)
      {
          for (int i = 0; i < listOfData.Count; ++i)
          {
              GoodsConsultInfo g = listOfData[i];
              Response.Write("<script language=\"javascript\" >\r\n");
              Response.Write("BaseData.push(" + JSONHelper.ObjectToJson<GoodsConsultInfo>(g) + ")\r\n");
              Response.Write("</script>");

              int rowspan = 1;
              if (!string.IsNullOrEmpty(g.Consult.ReplyContent)) rowspan = 2;
   %>
  <tr onmouseover="this.style.backgroundColor='#F2F2F2';" onmouseout="this.style.backgroundColor='#FFFFFF';">
    <td align="center" rowspan="<%=rowspan %>" bgcolor="#ffffff"><%=(p.CurPage-1)*p.PageSize +i+1 %>.</td>
    <td align="left"><img src="/Manage/Images/zixun.png" width="14" height="13" /> 咨询内容：<%=g.Consult.ConsultContent %>
    <% if (string.IsNullOrEmpty(g.Consult.ReplyContent))
       { %>
     [<a href="javascript:Reply(<%=i %>);" class="green">马上回复</a>]
     <%} %>
     </td>
    <td align="center"><a href="/Show.aspx?GoodsID=<%=g.Consult.GoodsID %>" target="_blank" title="点击查看<%=g.GoodsName %>详细信息"><%=Utility.GetMaxString(g.GoodsName,30,true) %></a></td>
    <td align="center"><a href="UsersManage.aspx?KeyWords=<%=g.UserName %>" title="点击查看会员信息"><%=g.UserName %></a></td>
    <td align="center"><%=g.Consult.ConsultDate.ToString("yyyy-MM-dd HH:mm:ss") %>
    <td align="center">[<a href="javascript:Reply(<%=i %>);">回复</a>] [<a href="javascript:Delete(<%=g.Consult.GoodsConsultID %>);" class="red">删除</a>] </td>
  </tr>

  <% if(!string.IsNullOrEmpty(g.Consult.ReplyContent))
     { %>
  <tr onmouseover="this.style.backgroundColor='#F2F2F2';" onmouseout="this.style.backgroundColor='#FFFFFF';">
  
    <td colspan="5" align="left" class="orange2"><img src="/Manage/Images/reply.png" width="14" height="13" /> 
    <%=Config.ShoppingShortName %>回复：<%=g.Consult.ReplyContent %> <%=g.Consult.ReplyDate.HasValue? g.Consult.ReplyDate.Value.ToString("yyyy-MM-dd HH:mm:ss"):"" %></td>
    </tr>
    <%} %>

    <%}
        %>
  <tr>
    <td colspan="6" align="center">
    <span class="page" >
         <%=Utility.GetPageLine(Utility.GetWebPageUrlNoCurPage(), p.CurPage, p.PageSize, 10, p.TotalCount)%>        </span>    </td>
    </tr>
    <%}
      else
      { %>
  <tr>
    <td colspan="6" align="center"><span class="red">[ 未找到任何商品咨询信息！]</span></td>
    </tr>
    <%} %>
</table>

</asp:Content>
